package com.bytedance.dao;

import org.apache.ibatis.jdbc.SQL;

public class UserProvider {

    public String insertSQL() {
        String sql = new SQL()
                .INSERT_INTO("tbl_user")
                .VALUES("username", "#{username}")
                .VALUES("password", "#{password}")
                .toString();
        return sql;
    }

    public String updateSQL() {
        String sql = new SQL()
                .UPDATE("tbl_user")
                .SET("username=#{username}")
                .SET("password=#{password}")
                .toString();
        return sql;
    }

    public String selectByIdSQL() {
        String sql = new SQL()
                .SELECT("*")
                .FROM("tbl_user")
                .WHERE("id=#{id}")
                .toString();
        return sql;
    }

    public String selectByUsernameSQL() {
        String sql = new SQL()
                .SELECT("*")
                .FROM("tbl_user")
                .WHERE("username=#{username}")
                .toString();
        return sql;
    }
}
